package com.education.common.util;

/**
 * 响应码，方便处理ajax请求
 * @author 余一
 * @date 2021/9/12  9:27
 */
public class ResultCode {
    public static final int UN_AUTH_ERROR_CODE = 401;//token失效
    public static final int IS_NOT_ACTIVATE = 2;//未激活状态
    public static final int NO_PERMISSION = 406;//权限不足
    public static final int SUCCESS = 1;//响应成功
    public static final int FAIL = 0;//响应失败
    public static final int CODE_ERROR = 2;//验证码错误
    public static final int EXCEL_VERIFY_FAIL = 2;//Excel 表格数据校验异常

    public int code = SUCCESS;
    public String message = "操作成功";

    public ResultCode(int code) {
        this.code = code;
        if (code == FAIL){
            this.message = "操作失败";
        }
    }

    public ResultCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public ResultCode() {
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
